<?php

declare(strict_types=1);

namespace Modules\Intelligent\Models;

use Catch\Base\CatchModel as Model;

/**
 * @property $id
 * @property $creator_id
 * @property $created_at
 * @property $updated_at
 * @property $deleted_at
 * @property $otheroutboundfrom_id
 * @property $quantity
 * @property $storagelocation
 * @property $barcode
*/
class OtheroutboundfromSchedule extends Model
{
    

    protected $table = 'otheroutboundfrom_schedule';

    protected $fillable = [ 'id', 'creator_id', 'created_at', 'updated_at', 'deleted_at', 'otheroutboundfrom_id', 'quantity', 'storagelocation', 'barcode','material_no'];

    /**
     * @var array
     */
    protected array $fields = ['id','created_at','updated_at','otheroutboundfrom_id','quantity','storagelocation','barcode','material_no'];

    /**
     * @var array
     */
    protected array $form = ['id','created_at','updated_at','otheroutboundfrom_id','quantity','storagelocation','barcode','material_no'];
    
    /**
     * @var array
     */
    public array $searchable = [
        'othernumbers' => 'like',
        'incomingtype' => '=',
        'incomingdate' => '=',
        'state' => '=',
        'remark' => 'like',
        'backstate' => 'like',
        'writeback' => 'like',
    ];
    
    //输出相应的时间格式
    protected function serializeDate($date)
    {
        return $date->format('Y-m-d H:i');
    }

     /**
     * 链表查询
     */
    public function detailscheckOne()
    {
        return $this->hasOne(Otherstorageschedule::class);//查一条
    }

    public function detailscheckAll()
    {
        return $this->hasMany(Otherstorageschedule::class);//查多条
    }
    
    //打印链表
    public function BarcodeprintingAll()
    {
        return $this->hasMany(Otherstorageschedule::class);//查多条
    }
    

    
}
